package open.template.work.gateway.controller;

import open.template.work.commons.exception.BaseTemplateException;
import open.template.work.commons.exception.ExceptionCodeEnum;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExceptionHandler implements ErrorController {

    @Override
    public String getErrorPath() {
        return "/error";
    }

    @RequestMapping("/error")
    public String error(){
        return new BaseTemplateException(ExceptionCodeEnum.S99999).toString();
    }
}
